{extend name="$_admin_base_layout" /}
{block name="content"}
<!-- Main Container -->

<div class="row">
    <div class="col-md-12">
        <div class="block">
            <div class="block-header bg-gray-lighter">
                <ul class="block-options">
                    <li>
                        <button type="button" data-toggle="block-option" data-action="refresh_toggle"
                                data-action-mode="demo"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"><i
                                class="si si-size-fullscreen"></i></button>
                    </li>
                </ul>
                <h3 class="block-title">店铺账务</h3>
            </div>
            <div class="block-content tab-content">
                <div class="tab-pane active">
                    <div class="block-content">
                        <form class="form-horizontal form-builder row" name="form-builder"
                              action=""
                              method="get">

                            <div class="form-group col-md-3 " id="form_group_search">
                                <label class="col-xs-12" for="search">条件</label>

                                <div class="col-sm-12">

                                    <input class="form-control" type="text" id="search" name="search" value="{if condition='isset($search)'}{$search}{/if}"
                                           placeholder="请输入条件">
                                </div>
                            </div>

                            <div class="form-group col-md-3 " id="form_group_date1">
                                <label class="col-xs-12">日期范围</label>

                                <div class="col-md-12">
                                    <div class="input-daterange input-group" data-date-format="yyyy-mm-dd">
                                        <input class="form-control" type="text" id="date1" name="date1" value="{if condition='isset($startDate)'}{$startDate}{/if}"
                                               placeholder="{if condition='isset($startDate)'}{$startDate}{else/}开始日期{/if}">
                                        <span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
                                        <input class="form-control" type="text" id="date2" name="date2" value="{if condition='isset($endDate)'}{$endDate}{/if}"
                                               placeholder="{if condition='isset($endDate)'}{$endDate}{else/}结束日期{/if}">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group col-md-4" id="form_group_btnGroup">
                                <div class="col-xs-12">
                                    <br>
                                    <button type="submit" class="btn  btn-primary btn-rounded">确定搜索</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="block-content tab-content">
                <div class="tab-pane active">

                    <div class="row data-table-toolbar">
                        <div class="col-sm-12">


                            <div class="toolbar-btn-action">
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-builder table-hover table-bordered table-striped js-table-checkable "
                               style="table-layout:fixed;">
                            <thead>
                            <tr>
                                <th class="" rowspan="2" colspan="1" style="text-align: center;vertical-align: middle;font-size: 17px;">店铺名称
                                </th>
                                <th class="" rowspan="2" colspan="1" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    期初余额
                                </th>
                                <th class=""  rowspan="1" colspan="3" style="text-align: center;vertical-align: middle;">
                                    增加
                                </th>
                                <th class=""   rowspan="1" colspan="4"  style="text-align: center;vertical-align: middle;">
                                    减少
                                </th>

                                <th class=""style="text-align: center;vertical-align: middle;font-size: 17px;" rowspan="2" colspan="1">

                                    期末余额
                                </th>
                                <th class=""   rowspan="1" colspan="5"  style="text-align: center;vertical-align: middle;">
                                    信用额度
                                </th>
                                <th class=""   rowspan="2"   style="text-align: center;vertical-align: middle;">
                                    实际余额
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;font-size: 17px;"  rowspan="2" colspan="1">

                                    操作
                                </th>
                            </tr>
                            <tr>
                                <th class="" style="text-align: center;vertical-align: middle;">
                                    充值
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">
                                    调整
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">
                                    退货
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">
                                    还款
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    订单
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    调整
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    提现
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    信用额度期初
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    固定额度
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    临时额度
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    信用额度消费
                                </th>
                                <th class="" style="text-align: center;vertical-align: middle;">

                                    信用额度期末
                                </th>

                            </tr>
                            </thead>
                            <tr>
                                {foreach name="account" key="k" item="vo"}
                                {if condition="isset($vo[1])"}
                                <td class="">
                                    {$vo.1.0.shop_name}
                                </td>
                                <td class="">
                                    {$vo.1.0.balance|getPrice}
                                </td>
                                {else/}
                                <td class="">
                                    {$vo.2.0.shop_name}
                                </td>
                                <td class="">
                                    0
                                </td>
                                {/if}
                                <td class="">
                                    {if condition="isset($vo[1]['type'][7])"}
                                    {$vo.1.type.7.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][15])"}
                                    {$vo.1.type.15.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][2])"}
                                    {$vo.1.type.2.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][6])"}
                                    {$vo.1.type.6.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][1])"}
                                    {$vo.1.type.1.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][4])"}
                                    {$vo.1.type.4.num|abs|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[1]['type'][3])"}
                                    {$vo.1.type.3.num|abs|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td  class="balance">
                                    {if condition="isset($vo[1]['type']['closing_balance'])"}
                                    {$vo.1.type.closing_balance|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="creditlimit_period">
                                    0
                                </td>
                                <td class="member_creditlimit">
                                    {if condition="isset($vo[2]['type'][13])"}
                                    {$vo.2.type.13.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="temporary_creditlimit">
                                    {if condition="isset($vo[2]['type'][12])"}
                                    {$vo.2.type.12.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="">
                                    {if condition="isset($vo[2]['type'][11])"}
                                    {$vo.2.type.11.num|getPrice}
                                    {else/}
                                    0
                                    {/if}
                                </td>
                                <td class="" class="credit_limit">
                                    0
                                </td>
                                <td class="" class="actual_limit">
                                    0
                                </td>
                                <td class="">
                                    <div class="btn-group">
                                        <a style="margin-right:8px;" title="" icon="fa fa-fw fa-eye"
                                           class="btn btn-xs btn-default" href="/admin.php/capital/shopcapital/shop_account/shopid/{$k}/startDate/{$Think.get.date1}/endDate/{$Think.get.date2}.html"
                                           data-toggle="tooltip" data-original-title="查看详情">
                                            <i class="fa fa-fw fa-eye"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                    </div>
                    <div class="data-table-toolbar">
                        <div class="row">
                            <div class="col-sm-12">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
{/block}


{block name="script"}
<script src="/public/static/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        App.initHelpers(["datepicker"]);

    })
</script>
{/block}




